Repository navigation
Conversation
A depth-stencil texture in "SHADER_RESOURCE" was in
"VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL" and its "TEXTURE" views expected that layout,
so it could not be sampled while bound as a read-only depth-stencil attachment
("DEPTH_STENCIL_READONLY", e.g. soft particles): the descriptor layout never matched
(VUID-vkCmdDraw-imageLayout-00344). Shader reads of depth-stencil textures now use
"VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL" for both the barrier layout and the
descriptor, the Vulkan counterpart of NVIDIA-RTX#266 ("DIRECT_QUEUE_GENERIC_READ" on D3D12).
SDK-backed upscalers (FSR, DLSR, DLRR) sample their inputs in
"VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL", so CmdDispatchUpscale moves a depth-stencil
depth guide into that layout around the SDK call and back.
dzhdanNV
added a commit
that referenced
this pull request
Oct 19, 2026
… read-only access control (#273)
Collaborator
|
Thanks! Sorry for the hassle with read-only stuff. After some thinking I decided to stay explicit, but instead of adding a flag, I reused already existing |
Contributor
Author
|
No worries! Thanks for putting in the effort to fix it properly. I'll try your patch some time tomorrow. Will let you know |
Collaborator
|
No, thanks to you! Sure. Keeping this one open until you confirm that the fix is legit. |
Contributor
Author
|
Yes, it works! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was running into some issues when sampling depth-stencil textures in the read-only attachment layout (for particle systems).
I had Claude look into it and generate two different solutions.
The first added a Vulkan only flag (see change list).
I wasn't sure how you'd feel about that, so I asked it to create a different solution and it came up with this version.
Claude told me this solution might even be "faster than the current", but the upscalers would need a dual barrier to move to the expected layout for the SDK and back to the NRI expected layout.
Here is the PR desc it generated; Let me know which of the two you'd prefer and/or if you know of a better way to fix this.